#if !defined(__APP_MESSAGE_H__)
#define __APP_MESSAGE_H__

typedef enum
{
    CONNECTION_NONE,
    CONNECTION_BT,
    CONNECTION_LORA,
    CONNECTION_CAN
} ConnectionType;

typedef struct
{
    ConnectionType connection_type;
    unsigned char *ptr;
    int id_len;
    int msg_len;
} Message;

int app_message_initByJson(Message *message, char *json, int len);
int app_message_initByBinary(Message *message, void* ptr, int len);

int app_message_toJson(Message *message, char *json, int len);
int app_message_toBinary(Message *message, void* ptr, int len);

void app_message_free(Message *message);

#endif // __APP_MESSAGE_H__
